<template>
<el-card>
    <!-- 面包屑 -->
    <el-breadcrumb separator="/">
        <el-breadcrumb-item>首页</el-breadcrumb-item>
        <el-breadcrumb-item>采集设备管理</el-breadcrumb-item>
    </el-breadcrumb>
    <!-- 列表 -->
    <el-table :data="sensorlist" style="width: 100%" class="userTable">
        <!-- type="index" -->
        <el-table-column type="index" label="#">
        </el-table-column>
        <el-table-column prop="sensor_no" label="设备编号">
        </el-table-column>
        <el-table-column prop="sensor_name" label="设备名称">
        </el-table-column>
        <el-table-column prop="sensor_var" label="设备简称">
        </el-table-column>
        <el-table-column prop="" label="操作">
            <template>
                <el-button size="mini" plain type="primary" icon="el-icon-edit" circle></el-button>
                <el-button size="mini" plain type="danger" icon="el-icon-delete" circle></el-button>
            </template>
        </el-table-column>
    </el-table>
</el-card>
</template>

<script>
export default {
    data() {
        return {
            sensorlist: []
        }
    },
    created() {
        this.getSensorList()
    },
    methods: {
        async getSensorList() {
            const res = await this.$http.post('getSensorList')
            console.log(res)
            if (res.status === 200) {
                const {
                    data,
                    msg,
                    code
                } = res.data
                this.sensorlist = data
                this.$message.success(msg)

            } else {
                this.$message.error('数据请求失败')
            }

        }
    }
}
</script>

<style>
.userTable {
    margin-top: 20px;
}
</style>
